//
//  AdoptOrderView.m
//  PigMarket
//
//  Created by 张敬 on 2019/9/6.
//  Copyright © 2019年 pigmarket.oc. All rights reserved.
//

#import "AdoptOrderView.h"

@implementation AdoptOrderView

#pragma mark - init method

- (void)setupUI {
    // 添加子控件
    [self addSubview:self.pigTitle];
    [self addSubview:self.personalRemarkLab];
    [self addSubview:self.numLab];
    [self addSubview:self.pigIcon];
    [self addSubview:self.priceLab];

}

- (void)setupLayout {
    // 布局子控件
    [self.pigIcon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(18);
        make.height.mas_equalTo(64);
        make.width.mas_equalTo(92);

    }];

    
    [self.pigTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.pigIcon.mas_right).offset(10);
        make.top.mas_equalTo(18);
        make.height.mas_equalTo(21);
        make.right.mas_equalTo(-15);
    }];
    
    [self.numLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.pigIcon.mas_right).offset(10);
        make.top.mas_equalTo(self.pigTitle.mas_bottom).offset(5);
        make.height.mas_equalTo(21);
        make.right.mas_equalTo(-15);
    }];
    
    [self.priceLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.pigIcon.mas_right).offset(10);
        make.top.mas_equalTo(62);
        make.height.mas_equalTo(21);
        make.right.mas_equalTo(-15);
    }];

    
    [self.personalRemarkLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(95);
        make.right.mas_equalTo(-10);
        make.bottom.mas_equalTo(-10);
    }];
}

#pragma mark - getter and setter

- (UIImageView *)pigIcon{
    
    if (!_pigIcon) {
        _pigIcon = [UIImageView new];
    }
    return _pigIcon;
}

- (UILabel *)pigTitle {
    if (!_pigTitle) {
        _pigTitle = [[UILabel alloc] init];
        _pigTitle.textColor = UIColorFromRGB(0x121212);
        _pigTitle.font = mFont(15);
    }
    return _pigTitle;
}
- (UILabel *)numLab {
    if (!_numLab) {
        _numLab = [[UILabel alloc] init];
        _numLab.textColor = UIColorFromRGB(0x8D8D8D);
        _numLab.font = mFont(14);
    }
    return _numLab;
}

- (UILabel *)personalRemarkLab {
    if (!_personalRemarkLab) {
        _personalRemarkLab = [[UILabel alloc] init];
        _personalRemarkLab.textColor = [UIColor colorWithHexString:@"#999999"];
        _personalRemarkLab.font = [UIFont smallFont];
    }
    return _personalRemarkLab;
}

- (UILabel *)priceLab {
    if (!_priceLab) {
        _priceLab = [[UILabel alloc] init];
    }
    return _priceLab;
}


@end
